<?php
/**
 * Created by PhpStorm.
 * User: cape
 * Date: 2017/10/10
 * Time: 10:03
 */



function &gen_reference(){
    $value = 3;
    while ($value > 0){
        yield $value;
    }
}

foreach (gen_reference() as &$number){
    echo (--$number).'...';
}
